package cn.itcast.consumption.service;

import cn.itcast.consumption.Dao.UserDao;
import cn.itcast.consumption.feignclient.FeignClient;
import cn.itcast.consumption.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserService {

    @Autowired
    private FeignClient feignClient;

    public List<User> findUser(List<Long> ids) {
        List<User> users = new ArrayList<User>();
        for (Long id : ids) {
            User user = feignClient.findUser(id);
            users.add(user);
        }

        return users;
    }
}
